﻿using System;

namespace CoreLims.Models.CoreLims
{
    using Library = WikiLibrary;
    using Page = WikiPage;
    using PageComment = WikiPageComment;

    public sealed partial class Wiki
    {
        public static WikiLibrary Library;
        public static WikiPage Page;
        public static WikiPageComment PageComment;
        public static WikiFileManager FileManager;

    }

    /// <summary>
    /// 文档库
    /// </summary>
    public partial class WikiLibrary
    {
        public WikiLibrary()
        {
            this.Id = Guid.NewGuid().ToString();
            this.RecordTime = DateTime.Now;
        }

        public string Id { get; set; }

        /// <summary>
        /// 文档库或目录名称
        /// </summary>
        public string Name { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        public string CreateUserId { get; set; }

        /// <summary>
        /// 创建者姓名
        /// </summary>
        public string CreateUserName { get; set; }

        /// <summary>
        /// 记录创建时间
        /// </summary>
        public DateTime RecordTime { get; set; }

        /// <summary>
        /// 该目录所属父目录
        /// </summary>
        public string ParentDirectory { get; set; }
    }

    /// <summary>
    /// 文档库文章
    /// </summary>
    public partial class WikiPage
    {
        public WikiPage()
        {
            this.Id = Guid.NewGuid().ToString();
            this.RecordTime = DateTime.Now;
        }

        public string Id { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        public string CreatorId { get; set; }

        /// <summary>
        /// 创建者姓名
        /// </summary>
        public string CreatorName { get; set; }

        /// <summary>
        /// 页面所属目录
        /// </summary>
        public string ParentDirectory { get; set; }

        /// <summary>
        /// 页面标题
        /// </summary>
        public string Title { get; set; }

        /// <summary>
        /// 文章内容
        /// </summary>
        public string TextContent { get; set; }

        /// <summary>
        /// 关联的文件ID
        /// </summary>
        public string AssociatedFileId { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime RecordTime { get; set; }
    }

    /// <summary>
    /// 文档库文章评论
    /// </summary>
    public partial class WikiPageComment
    {
        public WikiPageComment()
        {
            this.Id = Guid.NewGuid().ToString();
            this.RecordTime = DateTime.Now;
        }

        public string Id { get; set; }

        /// <summary>
        /// 关联的文件ID
        /// </summary>
        public string PageId { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        public string CreatorId { get; set; }

        /// <summary>
        /// 创建姓名
        /// </summary>
        public string CreatorName { get; set; }

        /// <summary>
        /// 评论内容
        /// </summary>
        public string Comment { get; set; }

        /// <summary>
        /// 记录时间
        /// </summary>
        public DateTime RecordTime { get; set; }
    }

    /// <summary>
    /// 文件管理
    /// </summary>
    public partial class WikiFileManager
    {
        public WikiFileManager()
        {
            this.Id = Guid.NewGuid().ToString();
            this.CreatorTime = DateTime.Now;
            this.Version = 1;
            this.IsApproval = false;
            this.IsDirectory = false;
        }

        public string Id { get; set; }

        /// <summary>
        /// 如果改值为空说明是文件顶级分类，如果不为空则是父级目录ID
        /// </summary>
        public string ParentDirectory { get; set; }
        
        /// <summary>
        /// true 为目录，false 为文件
        /// </summary>
        public bool IsDirectory { get; set; }

        /// <summary>
        /// 文件编号
        /// </summary>
        public string FileNumber { get; set; }

        /// <summary>
        /// 文件年份
        /// </summary>
        public string Year { get; set; }

        /// <summary>
        /// 目录/文件名称
        /// </summary>
        public string FileName { get; set; }

        /// <summary>
        /// 版本号
        /// </summary>
        public int Version { get; set; }
        
        /// <summary>
        /// 修订次数
        /// </summary>
        public string Revise { get; set; }

        /// <summary>
        /// 文件拟制人
        /// </summary>
        public string DraftedBy { get; set; }

        /// <summary>
        /// 文件拟制日期
        /// </summary>
        public string DraftedDate { get; set; }

        /// <summary>
        /// 文件生效日期
        /// </summary>
        public string EffectiveDate { get; set; }

        /// <summary>
        /// 该字段暂未使用，可用来扩展
        /// </summary>
        public string TextId { get; set; }

        /// <summary>
        /// 创建者ID
        /// </summary>
        public string CreatorId { get; set; }

        /// <summary>
        /// 创建者姓名
        /// </summary>
        public string CreatorName { get; set; }

        /// <summary>
        /// 创建时间
        /// </summary>
        public DateTime CreatorTime { get; set; }

        /// <summary>
        /// 是否审批，暂未使用
        /// </summary>
        public bool IsApproval { get; set; }
    }

}
